package com.yonyougov.cruxtestcase.testcase.allbasequery;

import com.yonyougov.cruxtestcase.basecase.BaseCase;
import com.yonyougov.cruxtestcase.dto.BaseResponseDto;
import com.yonyougov.cruxtestcase.dto.BaseTestReqDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/common")
public class CommonQueryController implements BaseCase {
    private final CommonQueryService commonQueryService;

    public CommonQueryController(CommonQueryService commonQueryService) {
        this.commonQueryService = commonQueryService;
    }

    @Override
    public String getName() {
        return "通用查询接口调用";
    }

    @Override
    public String getRemark() {
        return "所有服务通用查询接口调用";
    }

    @Override
    public BaseResponseDto testcase(BaseTestReqDto baseDto) {
        return null;
    }

    @PostMapping(value = "/testcase")
    public List<BaseResponseDto>  testcase1(@RequestBody BaseTestReqDto baseDto) {
        return commonQueryService.commonQuery(baseDto);
    }
}
